Skip to content

fix(ai): drop effort markers when thinking is disabled - #1399

Open
chupe wants to merge 1 commit into
code-yeongyu:mainfrom
chupe:fix/anthropic-disabled-effort-markers
Open

fix(ai): drop effort markers when thinking is disabled#1399
chupe wants to merge 1 commit into
code-yeongyu:mainfrom
chupe:fix/anthropic-disabled-effort-markers

Conversation

@chupe

@chupe chupe commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Removes generated per-turn effort markers when an Anthropic request disables thinking. disableThinkingForRequest() already removed top-level output_config, but historical and current effort-only system messages survived and could trigger messages.N: output_config.effort 'xhigh' is not supported when thinking is disabled.

The cleanup runs only after the cannot-disable early return. It preserves enabled xhigh/max, models that cannot disable thinking, persisted history, tool pairs, and cache checkpoints.

Related merged work: #351 and #380. Those changes establish thinking compatibility and cross-model degradation but do not remove these generated history markers.

Verification

Check Result
Explicit-off and tool-continuation final-fetch regressions before the fix 2 expected failures, 15 existing passes
Focused effort/thinking/history suites 37 passed, 1 existing opt-in live skip
Anthropic provider group 205 passed, 39 existing opt-in live cases skipped
Root bun run check Passed, including compiler and browser smoke
Telemetry build and AI build:offline Passed
Real source CLI, seeded history with xhigh and thinking off Exit 0; disabled thinking; no effort markers
Real source CLI, cross-model tool continuation Exit 0; disabled thinking; no effort markers; tool pair retained
Real source CLI, enabled xhigh Exit 0; adaptive thinking; xhigh marker retained
Isolation Every sandbox removed; real auth unchanged
Independent gate review APPROVE; focused suite independently reproduced with 37 passes and the existing live skip

Exact commands and sanitized receipts are retained locally under local-ignore/qa-evidence/20260905-effort-upstream/ (red.txt, green.txt, cli-qa.json, README.md), excluded from Git per repository policy. CLI cases use the repository's QA sandbox and localhost fake-model helpers.

Scope and risk

The production change is ten lines in the existing disable path. Tests cover the final SDK request, caller-context immutability, signed-thinking replay, cache controls, and both cannot-disable gates. No dependency or lockfile changes. LSP initialization was unavailable with TypeScript 7; repository compiler/build checks passed.


Summary by cubic

Fixes the Anthropic request builder so per-turn effort markers are removed when thinking is disabled, preventing output_config.effort errors on requests that disable thinking explicitly or through cross-model tool continuation.

Previously only top-level output_config was stripped, leaving historical and current effort-only system messages. The cleanup now filters those messages when disableThinkingForRequest() emits thinking: { type: "disabled" }. Enabled xhigh/max reasoning, models that cannot disable thinking, persisted history, tool pairs, and cache checkpoints are unaffected.

Written for commit 655226e. Summary will update on new commits.

Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant